package app.netant.book.feisuxs;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class FeisuxsRoot extends BaseRoot {
	
	private String type = "玄幻魔法";
	
	public FeisuxsRoot(){
		this.homeUrl = "http://www.feisuxs.net/fenlei2/fenlei2-2.html";
		this.pageUrl = "http://www.feisuxs.net/fenlei2/fenlei";
		this.tableKey = "feisuxs";
		this.type = "武侠仙侠";
	}

	@Override
	public String buildUrl(int pageIdx) {
		return this.pageUrl + pageIdx+"-1.html";
	}

	@Override
	public BasePage buildPage(String url) {
		return new FeisuxsPage(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new FeisuxsDetail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new FeisuxsEntity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		entity.setNovelType(this.type);
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		FeisuxsRoot root = new FeisuxsRoot();
		root.analyse(81);
		//root.excepCycle();
	}


	
}
